package com.example.user.dal.dataobject.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.framework.mybatis.core.dataobject.BaseDO;
import com.example.user.constants.UserConstants;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * @author yuzhenxin
 * @date 2023/3/27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor // 使用 @Builder 后，mybatis不select所有字段，就会报错，要加上无参构造
@AllArgsConstructor
@Builder
@TableName("t_user")
@Accessors(chain = true)
public class UserDO extends BaseDO {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    private String userId;

    private String name;

    private String mobile;

    private String email;

    private String avatar;

    private Long avatarTimestamp;

    private String password;

    /**
     * 用户注册来源
     *
     * @see UserConstants
     */
    private Integer source;

    /**
     * 用户数据所在地区（注册后不支持修改）
     */
    private String registerCountryId;

    /**
     * 用户所在地区
     */
    private String countryId;

    private Boolean subscribeEmail;

    private String permissions;
}
